package com.handinglian.ai.template.mapper;
import java.util.Collection;

import com.handinglian.ai.template.dto.CallTemplateDto;
import com.handinglian.ai.template.dto.MessageTemplateDto;
import com.handinglian.ai.template.entity.MessageTemplate;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface MessageTemplateMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MessageTemplate record);

    int insertOrUpdate(MessageTemplate record);

    int insertOrUpdateSelective(MessageTemplate record);

    int insertSelective(MessageTemplate record);

    MessageTemplate selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(MessageTemplate record);

    int updateByPrimaryKey(MessageTemplate record);

    int updateBatch(List<MessageTemplate> list);

    int batchInsert(@Param("list") List<MessageTemplate> list);

    List<MessageTemplateDto> list(@Param("nameOrContent") String nameOrContent, @Param("types") List<Integer> types, @Param("sortField") String sortField, @Param("sortOrder") String sortOrder);

    int updateIsDefaultById(@Param("id")Integer id);

    int updateIsDefault();

    int deleteByIdIn(@Param("idCollection")Collection<Integer> idCollection);

    List<MessageTemplateDto> findByTypeOrderByIsDefaultDesc(@Param("type")Integer type);
}